/**
 * Created by Administrator on 2015/11/29.
 */

console.log(print);//[Function:print]
console.log(myprint);//undefined

function print(){
    console.log('hello');
}

var myprint = function(){
    console.log('haha')
};

console.log(print);//[Function:print]
console.log(myprint);//[Function]

var myf = new Function('return 1+1');
console.log(myf());

var myf1 = new Function('return this.name');
console.log(myf1.call({name:'dongge'}));

//function (x){
//    console.log(x);
//}(1);
var a = 1;
var b = 2;
var myf2 = new Function('a','b','return a+b');
console.log(myf2(1,2));

+function(){
    function testdef(a,b){
        console.log(a);
        console.log(b);
    }
    testdef(1);
}();